package experiment;

import java.util.Random;

import army.Army;

public class Battle {
	Army army1;
	Army army2;
	Random rand;

	public Battle(Army army1, Army army2) {
		this.army1 = army1;
		this.army2 = army2;
	}

	public int fight() {
		while (army1.isAlive() && army2.isAlive()) {
			fightRound();
		}
		return army1.getArmySize() - army2.getArmySize();
	}

	public void fightRound() {
		int army1Hits = army1.strike();
		int army2Hits = army2.strike();
		army1.subtractHits(army2Hits);
		army2.subtractHits(army1Hits);
	}

	
	
}
